﻿<%@ Register TagPrefix="ucCommon" TagName="Common" Src="../Common/Inc/Common.ascx" %>
<%@ Register TagPrefix="ucTop" TagName="Top" Src="../Common/Inc/Top.ascx" %>
<%@ Register TagPrefix="ucMenu" TagName="Menu" Src="../Common/Inc/Menu.ascx" %>
<%@ Register TagPrefix="ucTabTitle" TagName="TabTitle" Src="../Common/Inc/TabTitle.ascx" %>
<%@ Register TagPrefix="ucCopyright" TagName="Copyright" Src="../Common/Inc/Copyright.ascx" %>
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Com1013m.aspx.cs" Inherits="Updms.Com.Com1013m" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>▒ UPDMS [Com1013m] ▒▒▒▒▒▒▒▒▒▒</title>
<ucCommon:Common id="Common" runat="server"></ucCommon:Common>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager runat="server" id="ScriptManager1" EnableScriptGlobalization="true"></asp:ScriptManager>

<table id="table_frame">
	<tr>
		<td id="top_area" colspan="2">
			<!-- Top 시작 -->
			<ucTop:Top id="Top" runat="server"></ucTop:Top>
			<!-- Top 끝 -->
		</td>
	</tr>
	<tr>
		<td id="menu_area">
			<!-- 메뉴 시작 -->
			<ucMenu:Menu id="Menu" runat="server"></ucMenu:Menu>
			<!-- 메뉴 끝 -->
		</td>
		<td id="contents_area">
			<!-- 제목 시작 -->
			<ucTabTitle:TabTitle id="TabTitle" TagPrefixs="Com1013m" runat="server"></ucTabTitle:TabTitle>
			<!-- 제목 끝 -->
			<!-- AJAX 시작 -->
			<asp:UpdatePanel ID="UpdatePanel1" runat="server">
			<Triggers>
				<asp:PostBackTrigger ControlID="ibtn_excel"/>
			</Triggers>
			<ContentTemplate>			
			<!-- 버튼 시작 -->
			<div class="button_area">
				<asp:linkbutton id="ibtn_excel" Text="엑셀" runat="server" CssClass="ibtn ibtn_excel" OnClick="ibtn_excel_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_delete" Text="삭제" runat="server" CssClass="ibtn ibtn_delete" OnClientClick="return chkDelete()" OnClick="ibtn_delete_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_save" Text="저장" runat="server" CssClass="ibtn ibtn_save" OnClientClick="return chkSave()" OnClick="ibtn_save_Click"></asp:linkbutton>
				<asp:linkbutton id="ibtn_search" Text="검색" runat="server" CssClass="ibtn ibtn_search" OnClick="ibtn_search_Click"></asp:linkbutton>
			</div>
			<!-- 버튼 끝 -->
			<!-- 검색 시작 -->
			<table class="table_search">
				<tr>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_search_user_id" Text="아이디" runat="server" /></td>
					<td class="ctl" width="22%"><asp:textbox id="txt_search_user_id" runat="server" Width="98%" CssClass="ib_b"></asp:textbox></td>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_search_nm" Text="이름" runat="server" /></td>
					<td class="ctl" width="22%"><asp:textbox id="txt_search_nm" runat="server" Width="98%" CssClass="ib_b"></asp:textbox></td>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_search_user_level" Text="권한" runat="server" /></td>
					<td class="ctl" width="22%">
						<ul class="horizontal">
							<li style="width:40%;"><asp:dropdownlist id="ddl_search_user_level" runat="server" Width="99%"></asp:dropdownlist></li>
							<li style="width:60%;"><asp:dropdownlist id="ddl_search_user_div" runat="server" Width="100%"></asp:dropdownlist></li>
						</ul>
					</td>
				</tr>
			</table>
			<!-- 검색 끝 -->
			<!-- 디테일1 시작 -->
			<table class="table_detail">
				<tr>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_user_id" Text="아이디" runat="server" /></td>
					<td class="ctl" width="22%">
						<ul class="horizontal">
							<li style="width:90%;"><asp:textbox id="txt_user_id" runat="server" Width="98%" CssClass="ib_b req"></asp:textbox></li>
							<li style="width:6%;padding:2px 0 0 4px;"><asp:linkbutton id="lbtn_user_id_check" runat="server" OnClientClick="return chkUserId()" OnClick="lbtn_user_id_check_Click"><span class="sbtn sbtn_exclam" title="유효성체크"></span></asp:linkbutton></li>
						</ul>
					</td>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_pw" Text="비밀번호" runat="server" /></td>
					<td class="ctl" width="22%">
						<ul class="horizontal">
							<li style="width:90%;"><asp:textbox id="txt_pw" runat="server" Width="98%" TextMode="Password" CssClass="ib_b req"></asp:textbox></li>
							<li style="width:6%;padding:2px 0 0 4px;"><asp:linkbutton id="ibtn_change_pw" runat="server" CssClass="sbtn sbtn_change_pw"></asp:linkbutton></li>
						</ul>
					</td>
					<td class="lbl" width="11%"><asp:Literal ID="ltr_nm" Text="이름" runat="server" /></td>
					<td class="ctl" width="22%"><asp:textbox id="txt_nm" runat="server" Width="98%" CssClass="ib_b req"></asp:textbox></td>
				</tr>
				<tr>
					<td class="lbl"><asp:Literal ID="ltr_user_level" Text="접근권한" runat="server" /></td>
					<td class="ctl"><asp:dropdownlist id="ddl_user_level" runat="server" CssClass="ddl" AutoPostBack="True" OnSelectedIndexChanged="ddl_user_level_SelectedIndexChanged"></asp:dropdownlist></td>
					<td class="lbl"><asp:Literal ID="ltr_start_page" Text="시작페이지" runat="server" /></td>
					<td class="ctl"><asp:dropdownlist id="ddl_start_page" runat="server" CssClass="ddl che"></asp:dropdownlist></td>
					<td class="lbl"><asp:Literal ID="ltr_user_div" Text="사용자구분" runat="server" /></td>
					<td class="ctl"><asp:dropdownlist id="ddl_user_div" runat="server" CssClass="ddl"></asp:dropdownlist></td>
				</tr>
				<tr>
					<td class="lbl"><asp:Literal ID="ltr_language_set" Text="언어" runat="server" /></td>
					<td class="ctl"><asp:DropDownList id="ddl_language_set" runat="server" CssClass="ddl"></asp:DropDownList></td>
					<td class="lbl"><asp:Literal ID="ltr_use_yn" Text="사용여부" runat="server" /></td>
					<td class="ctl tlpd4"><asp:RadioButtonList id="rbl_use_yn" runat="server" RepeatDirection="Horizontal" RepeatLayout="Flow" CssClass="rbl_flow">
							<asp:ListItem Value="Y" Selected="True">Y</asp:ListItem>
							<asp:ListItem Value="N">N</asp:ListItem>
						</asp:RadioButtonList></td>
					<td class="lbl"><asp:Literal ID="ltr_email" Text="이메일" runat="server" /></td>
					<td class="ctl"><asp:textbox id="txt_email" runat="server" Width="98%" CssClass="ib_b"></asp:textbox></td>
				</tr>
				<tr>
					<td class="lbl"><asp:Literal ID="ltr_remark" Text="비고" runat="server" /></td>
					<td class="ctl" colspan="5"><asp:textbox id="txt_remark" runat="server" Width="99.5%" CssClass="ib_b"></asp:textbox></td>
				</tr>
			</table>
			<!-- 디테일1 끝 -->
			<!-- 리스트셋 시작 -->
			<table cellpadding="0" cellspacing="0" border="0" width="100%">
				<tr>
					<td>
						<!-- 검색어 시작 -->
						<div class="div_left">Keyword : <asp:label id="lbl_search_keyword" runat="server"></asp:label></div>
						<div class="div_right"><asp:checkbox id="cb_list_all" runat="server" AutoPostBack="True" OnCheckedChanged="cb_list_all_CheckedChanged" ToolTip="Show All"></asp:checkbox></div>
						<!-- 검색어 끝 -->
					</td>
				</tr>
				<tr>
					<td>
						<!-- 리스트 시작 -->
						<asp:GridView ID="GridView1" CssClass="table_gridview" GridLines="None" runat="server" AutoGenerateColumns="False" OnRowDataBound="GridView1_RowDataBound" OnRowCommand="GridView1_RowCommand" DataKeyNames="Pw,User_Div,Start_Page">
							<Columns>
								<asp:TemplateField HeaderText="&lt;a href=&quot;javascript:void(0);&quot; onclick=&quot;checkBoxCheck('GridView1');&quot;&gt;S&lt;/a&gt;">
									<ItemTemplate>
										<input id="cb_check" class="cb" type="checkbox" onclick="reverseRow('GridView1', 0);" runat="server" />
									</ItemTemplate>
									<ItemStyle HorizontalAlign="Center" Width="2%" />
								</asp:TemplateField>
								<asp:BoundField HeaderText="번호" >
									<ItemStyle HorizontalAlign="Center" Width="4%" />
								</asp:BoundField>
								<asp:TemplateField HeaderText="아이디">
									<ItemStyle HorizontalAlign="Left" Width="8%" />
									<HeaderStyle CssClass="lbtn_rc" />
									<ItemTemplate>
										<asp:LinkButton ID="lbtn_rc" runat="server" Text='<%# Bind("User_Id") %>'></asp:LinkButton>
									</ItemTemplate>
								</asp:TemplateField>
								<asp:BoundField DataField="Pw" HeaderText="Pw(X)" Visible="False" />
								<asp:BoundField DataField="Nm" HeaderText="이름">
									<ItemStyle HorizontalAlign="Left" Width="10%" />
								</asp:BoundField>
								<asp:BoundField DataField="Email" HeaderText="이메일">
									<ItemStyle HorizontalAlign="Left" Width="12%" />
								</asp:BoundField>
								<asp:BoundField DataField="User_Level" HeaderText="접근권한">
									<ItemStyle HorizontalAlign="Center" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="User_Div" HeaderText="User_Div(X)" Visible="False" />
								<asp:BoundField DataField="User_Div_Nm" HeaderText="사용자구분">
									<ItemStyle HorizontalAlign="Left" Width="14%" />
								</asp:BoundField>
								<asp:BoundField DataField="Start_Page" HeaderText="Start_Page(X)" Visible="False" />
								<asp:BoundField DataField="Pgm_Nm" HeaderText="시작페이지">
									<ItemStyle HorizontalAlign="Left" Width="20%" />
								</asp:BoundField>
								<asp:BoundField DataField="Language_Set" HeaderText="언어">
									<ItemStyle HorizontalAlign="Center" Width="4%" />
								</asp:BoundField>
								<asp:BoundField DataField="Use_Yn" HeaderText="사용여부">
									<ItemStyle HorizontalAlign="Center" Width="6%" />
								</asp:BoundField>
								<asp:BoundField DataField="Remark" HeaderText="비고">
									<ItemStyle HorizontalAlign="Left" Width="12%" />
								</asp:BoundField>
							</Columns>
							<EmptyDataTemplate>
								<div id="no_data"></div>
							</EmptyDataTemplate>
						</asp:GridView>
						<!-- 리스트 끝 -->
					</td>
				</tr>
				<tr>
					<td>
						<!-- 페이징 시작 -->
						<div class="div_left">Result : <asp:label id="lbl_result_count" runat="server"></asp:label></div>
						<div class="div_right"><asp:label id="lbl_page" runat="server"></asp:label></div>
						<!-- 페이징 끝 -->
					</td>
				</tr>
			</table>
			<!-- 리스트셋 끝 -->
			<!-- 카피라이트 시작 -->
			<ucCopyright:Copyright id="Copyright" runat="server"></ucCopyright:Copyright>
			<!-- 카피라이트 끝 -->
			<!-- 히든값 시작 -->
			<div id="hdn_data">
				<asp:Label id="lbl_search_flag" runat="server"></asp:Label>
				<asp:label id="lbl_pw" runat="server" Visible="False"></asp:label>
				<input id="h_no" type="hidden" name="h_no" runat="server" />
				<input id="h_check_user_id" type="hidden" name="h_check_user_id" runat="server" />

				<!-- 비밀번호 변경 시작 -->
				<asp:Panel ID="Panel1" runat="server">
				<div class="div_window">
					<img id="img_close" src="../Common/Images/close.gif" class="hand" style="float:right;" onclick="hideModalPopupExtender();" alt="닫기" /><br />
					<object data="Com3016p.aspx?page_mode=MP&user_id=<%= SetChangeUserId() %>" style="width:500px; height:200px;"></object>
				</div>
				</asp:Panel>
				<!-- 비밀번호 변경 끝 -->
			</div>
			<!-- 히든값 끝 -->
			<!-- FilteredTextBoxExtender 시작 -->
			<act:FilteredTextBoxExtender ID="fte_user_id"
				runat="server"
				TargetControlID="txt_user_id"
				FilterType="Numbers,LowercaseLetters">
			</act:FilteredTextBoxExtender>
			<!-- 자동완성 시작 -->
			<act:AutoCompleteExtender ID="ace_search_user_id"
				runat="server"
				TargetControlID="txt_search_user_id"
				ServiceMethod="GetSearchData"
				ServicePath="../Common/Inc/AutoCompleteWebService.asmx"
				MinimumPrefixLength="1"
				CompletionSetCount="20"
				CompletionInterval="800"
				EnableCaching="true"
				UseContextKey="true"
				ContextKey="Com1013m_Id"
				CompletionListCssClass="ace_List"
				CompletionListItemCssClass="ace_ListItem"
				CompletionListHighlightedItemCssClass="ace_HighlightedItem" >
			</act:AutoCompleteExtender>
			<act:AutoCompleteExtender ID="ace_search_nm"
				runat="server"
				TargetControlID="txt_search_nm"
				ServiceMethod="GetSearchData"
				ServicePath="../Common/Inc/AutoCompleteWebService.asmx"
				MinimumPrefixLength="1"
				CompletionSetCount="20"
				CompletionInterval="800"
				EnableCaching="true"
				UseContextKey="true"
				ContextKey="Com1013m_Nm"
				CompletionListCssClass="ace_List"
				CompletionListItemCssClass="ace_ListItem"
				CompletionListHighlightedItemCssClass="ace_HighlightedItem" >
			</act:AutoCompleteExtender>
			<!-- 모달팝업 시작 -->
			<act:ModalPopupExtender ID="mpe_change_pw" runat="server"
				BehaviorID="mpe_change_pw_b"
				TargetControlID="ibtn_change_pw"
				PopupControlID="Panel1"
				CancelControlID="img_close"
				BackgroundCssClass="modalBackground" />
			</ContentTemplate>
			</asp:UpdatePanel>
			<!-- AJAX 끝 -->
		</td>
	</tr>
</table>

<asp:updateprogress AssociatedUpdatePanelID="UpdatePanel1" ID="updateProgress" runat="server">
	<progresstemplate>
		<div id="progressBackgroundFilter"></div>
		<div id="processMessage">
			<div id="processing"></div>
			<img src="../Common/Images/processing_img.gif" />
		</div>
	</progresstemplate>
</asp:updateprogress>

</form>
<script type="text/javascript" language="javascript" defer="defer">
	//아이디 중복체크
	function chkUserId() {
		if ($F("txt_user_id").blank()) {
			msgBox.alert(getMsg(MSG_ERR_009), setFocus, "txt_user_id"); //사용자 아이디를 입력해 주세요
			return false;
		}

		if ($F("txt_user_id").length < 5) {
			msgBox.alert(getMsg(MSG_ERR_075, [5]), setFocus, "txt_user_id"); //@자 이상 입력해 주세요
			return false;
		}

		return true;
	}

	//엔터 아이디 중복체크
	function enterCheckUserId(evt) {
		var e = (!evt) ? window.event : evt;
		var keyCode = e.keyCode;

		if (keyCode == 13) {
			if (chkUserId()) {
				__doPostBack('lbtn_user_id_check', '');
			}
		}
	}

	//저장
	function chkSave() {
		if ($F("txt_user_id").blank()) {
			msgBox.alert(getMsg(MSG_ERR_009), setFocus, "txt_user_id"); //아이디를 입력해 주세요
			return false;
		}

		if ($F("h_check_user_id").blank()) {
			msgBox.alert(getMsg(MSG_ERR_195), setFocus, "txt_user_id"); //아이디 중복체크를 하지 않았습니다
			return false;
		}

		//신규등록일때만 비밀번호 필수체크
		if ($F("h_no").blank()) {
			if ($F("txt_pw").blank()) {
				msgBox.alert(getMsg(MSG_ERR_002), setFocus, "txt_pw"); //비밀번호를 입력해 주세요
				return false;
			}
		}

		if ($F("txt_nm").blank()) {
			msgBox.alert(getMsg(MSG_ERR_010), setFocus, "txt_nm"); //이름을 입력해 주세요
			return false;
		}

		if ($F("ddl_user_level").blank()) {
			msgBox.alert(getMsg(MSG_ERR_011), setFocus, "ddl_user_level"); //권한을 입력해 주세요
			return false;
		}

		if ($F("ddl_start_page").blank()) {
			msgBox.alert(getMsg(MSG_ERR_015), setFocus, "ddl_start_page"); //하위프로그램만 선택해주세요
			return false;
		}

		msgBox.confirm(getMsg(MSG_CFM_000), doSave);	//저장하시겠습니까?
		return false;
	}

	//삭제
	function chkDelete() {
		if(!isCheckedOnGridView("GridView1", 0)) {
			msgBox.alert(getMsg(MSG_ERR_053));	//삭제할 항목을 선택하세요
			return false;
		}
		msgBox.confirm(getMsg(MSG_CFM_001), doDelete);	//삭제하시겠습니까?
		return false;
	}
	
	//상위시스템 선택불가
	function chkDisableOption(obj) {
		if (obj[obj.selectedIndex].value == "") {
			msgBox.alert(getMsg(MSG_ERR_015));	//하위프로그램만 선택해주세요
			obj.selectedIndex = 0;
			return;
		}
	}

	//비밀번호 변경창 숨기기
	function hideModalPopupExtender() {
		var mpeBehavior = $find('mpe_change_pw_b');
		mpeBehavior.hide();
	}

</script>
</body>
</html>